-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Rename standards.h header file #8093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
|
Thanks for your contribution. For consistency, please rename |
I still do not understand how a system include can utilize a local include as those should be separated. That means that any project could "poison" the system ones. Seems like there is a bug in the compiler or the project is misconfigured. I also do not like the new name as naming something |
|
@reshmavk do you have a real AIX machine or do you use some cloud service that we could test? |
|
I use a real AIX machine, not from the cloud. standards.h The error occurs when compiled using |
|
@firewave I can reproduce something similar on my debian machine. I put two files in current folder 1.c and stddef.h. 1.c: stddef.h on my machine stdio.h includes stddef.h using angle brackets: my stddef.h in local folder gets included: If I remove the |
|
the first suggestion by chat gpt is to not reuse header filenames. but.. who says that it's only standards.h we can include using more specific paths i.e.: I don't have very great ideas right now. |



Compilation of cppcheck fails in AIX fails with multiple undeclared errors as shown below:
AIX has a system header file named standards.h which defines certain macros based on which types like int8_t,int16_t,etc are defined in stdint.h header file. Since cppcheck also has a header file named standards.h and this takes precedence over the system header file during compilation, system provided standards.h is not included resulting in the above mentioned errors. For more information please refer https://sourceforge.net/p/cppcheck/discussion/development/thread/b5b3f765b4/
To resolve this issue, this PR implements a possible solution: cppcheck provided standards.h has been renamed to cppcheckstd.h and
#include "standards.h"has been replaced with#include "cppcheckstd.h"wherever required in the source code.Could you please let me know if these changes are acceptable to merge or if there is a better approach to address this issue. I appreciate your suggestions.